package com.keyidea.jfxui.portal.view.server.test;

import de.saxsys.mvvmfx.FxmlView;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebView;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ResourceBundle;

/**
 * 集成高德地图测试页面
 */
public class GisGaoDeTestView implements FxmlView<GisGaoDeTestViewModel>, Initializable {

    @FXML
    private WebView webView;

    @Override
    public void initialize(URL location, ResourceBundle resources) {

        // 假设你的HTML文件名为"index.html"，并且位于当前用户目录下
        //File indexHtml = new File(System.getProperty("user.dir"), "index.html");
        URL url = getClass().getResource("/com/keyidea/jfxui/portal/assets/maps/我的信息.html");
        // 加载本地HTML文件
        webView.getEngine().load(url != null ? url.toExternalForm() : null);

        //webView.getEngine().load("http://www.baidu.com");
    }
}
